<?php
include("include/config.inc.php");
$iserror = 0;
if(isset($_POST['email']) && strlen($_POST['email']) > 0 || isset($_POST['password']) && strlen($_POST['password']) > 0)
{
  $checkLogin = "SELECT userId,company,password
                   FROM user
                  WHERE email    = '".$_POST['email']."'
                    AND password = '".$_POST['password']."'
                    AND status = 'A'";
  $checkLoginresult = mysql_query($checkLogin);
  if($userLoginRow = mysql_fetch_array($checkLoginresult))
  {
    $_SESSION['s_activIds']    = $userLoginRow['userId'];
    $_SESSION['s_activusers']  = $userLoginRow['company'];
    header("Location:./myDoc.php");
  }
  else
  {
  	$iserror = 1;
  }
}
include("bottom.php");
$smarty->assign('iserror',$iserror);
$smarty->display("checkLogin.tpl");
?>